home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4128 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  912 b 

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: What is wrong with this code? (BC45)
  5. Date: Sun, 28 Jan 1996 01:24:23 GMT
  6. Organization: Netcom
  7. Message-ID: <310acfd3.93677184@nntp.ix.netcom.com>
  8. References: <yMOCxg2yqvDD083yn@iaccess.za>
  9. NNTP-Posting-Host: ix-dc6-02.ix.netcom.com
  10. X-NETCOM-Date: Sat Jan 27  5:24:16 PM PST 1996
  11. X-Newsreader: Forte Agent .99c/16.141
  12.  
  13. vincer@iaccess.za (Vince Risi) wrote:
  14.  
  15. > Why would I get an illegal initialization from this code?
  16. > typedef char * pchar;
  17. > pchar Fred = "This is a default value";
  18. > pchar Mark = Fred;    // <------ ????
  19. > Is this a BC45 bug?
  20.  
  21. Are you compiling as a C++ program?  In C that code is illegal at file
  22. scope (it's legal in a function as long as Mark is not static).
  23. Borland compilers assume C code if the file extension is .C, C++ if
  24. the extension is .CPP.
  25.  
  26.  
  27. Michael M Rubenstein
  28.